package pl.edu.mimuw.irs.rcp.controller.editor.workflow.command;

import pl.edu.mimuw.irs.core.model.design.net.IRSNode;
import pl.edu.mimuw.irs.core.util.Position;

public class EnableAutolayoutCommand extends IRSNodeCommand {

	private Position oldCustomPosition;

	// *** Constructors

	public EnableAutolayoutCommand(IRSNode node) {
		super(node);
		this.oldCustomPosition = node.getCustomPosition(); 
	}
	
	// *** Methods


	@Override
	protected void performExecute() {
		getNode().setCustomPosition(null);
	}

	@Override
	protected void performUndo() {
		getNode().setCustomPosition(oldCustomPosition);
	}
}
